<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:sec="http://www.springframework.org/schema/security"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">

	<!--  bean id="loggerListener"
		class="org.springframework.security.authentication.event.LoggerListener" / -->
		
	<sec:http auto-config="true">
		<sec:intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" />
		<sec:intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />
		<sec:form-login 
			login-page="/login.jsp" 
			login-processing-url="/j_spring_security_check" 
		 	default-target-url="/index.jsp" 
		 	authentication-failure-url="/login.jsp?login_error=1" />
	</sec:http>

	<!-- windows authentication provider -->
	<bean id="waffleWindowsAuthProvider" class="waffle.windows.auth.impl.WindowsAuthProviderImpl" />
	
	<!-- waffle authentication provider -->
	<bean id="waffleSpringAuthenticationProvider" class="waffle.spring.WindowsAuthenticationProvider">
		<property name="AllowGuestLogin" value="false" />
		<property name="PrincipalFormat" value="fqn" />
		<property name="RoleFormat" value="both" />
		<property name="AuthProvider" ref="waffleWindowsAuthProvider" />
	</bean>
	
	<!-- spring authentication provider -->
	<sec:authentication-manager alias="authenticationProvider">
		<sec:authentication-provider ref="waffleSpringAuthenticationProvider" />
	</sec:authentication-manager>		
</beans>
